package ink.metoo.auto.fishpi.call

import ink.metoo.auto.fishpi.ClientCaches

abstract class AbstractBaseBody {

    var apiKey: String? = null

    fun useFormCacheApiKey() {
        this.apiKey = ClientCaches.apiKey
    }

}

fun <T: AbstractBaseBody> T.fillFormCache(block: (T) -> Unit = {}): T {
    useFormCacheApiKey()
    block(this)
    return this
}


class CacheBaseBody : AbstractBaseBody() {
    init {
        useFormCacheApiKey()
    }
}
